package com.cjx.myself.controller.ssrf;

import com.cjx.myself.service.ssrf.SsrfService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author chujianxin
 * @version 1.0
 * @description: 审计的函数
 * 1. URL
 * 2. HttpClient
 * 3. OkHttpClient
 * 4. HttpURLConnection
 * 5. Socket
 * 6. ImageIO
 * 7. DriverManager.getConnection
 * 8. SimpleDriverDataSource.getConnection
 * @date 2024/1/3 20:25
 */
@RestController
@RequestMapping("/ssrf")
public class SSRFController {

    @Autowired
    private SsrfService ssrfService;


    @GetMapping("/ssrf1")
    public String URLConnection(String url) {
        return ssrfService.ssrf1(url);
    }


    @GetMapping("/ssrf2")
    public String URLConnection2(String url) {
        return ssrfService.ssrf2(url);
    }

    @GetMapping("/ssrf3")
    public String URLConnection3(String url) {
        return ssrfService.ssrf3(url);

    }

    @GetMapping("/ssrf4")
    public String HTTPURLConnection(String url) {
        return ssrfService.ssrf4(url);
    }

}
